const {
  // rootPath,
  getUserInfo
} = require("./storageUtils");

export const hasRole = (roleCode) => {
  const {
    roles
  } = getUserInfo();
  if (roles && roles instanceof Array && roles.length > 0) {
    console.log("roles",roles)
    console.log(roles.includes("admin"))
    return roles.includes(roleCode) || roles.includes("admin");
  } else {
    return false;
  }
}